APP_NAME=client
SHARE_NAME=mymqtt
CFLAGS +=-I /home/renhui/mylib/include
CFLAGS2 +=-I ./include
LDFAGS +=-L /home/renhui/mylib/lib
LDFAGS2 +=-L ./

all:share
	gcc ./src/client_main.c -o ${APP_NAME} ${CFLAGS} ${CFLAGS2} ${LDFAGS} ${LDFAGS2} -l${SHARE_NAME} -lmosquitto -lcjson -lzlog -lsqlite3


share:
	gcc -shared -fPIC -o lib${SHARE_NAME}.so ${CFLAGS} ${CFLAGS2} ./src/mqtt_conf.c ./src/dictionary.c ./src/iniparser.c ./src/data_sq.c ./src/callback.c ./src/platform.c

run:
	./${APP_NAME}

clean:
	rm -f ${APP_NAME}

disclean:clean
	rm -f *.o
	rm -f *.log
	rm -f *.log.*
	rm -f *.so
	rm -f *.db
